package demo1;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Set<String> set = new HashSet<>();

        while(n-- != 0){
            char[] s = in.next().toCharArray();
            Arrays.sort(s);
            set.add(new String(s));
        }
        System.out.println(set.size());
    }

}
